package file;

import java.io.File;

public class FileDeleteDemo1 {
    public static void main(String[] args) {
        File file = new File("hello.txt");
        if (file.exists() && file.isDirectory()){
            file.delete();
            System.out.println("文件删除成功");
        }else {
            System.out.println("文件不存在");


        }

    }


}
